Skip to content

Conversation

@codeboyzhou
Copy link
Contributor

What's Changed

  1. Use builder pattern for CallToolResult to replace deprecated method usages.
  2. Replace some lambda expressions with method reference to simplify code.
  3. Fix a typo in class AbstractMcpClientServerIntegrationTests.

Motivation and Context

Simplify code and improve readability.

How Has This Been Tested?

Just run the tests because there is no logic changes.

Breaking Changes

No.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

No.

@Kehrlann Kehrlann self-assigned this Nov 18, 2025
@Kehrlann
Copy link
Contributor

@codeboyzhou thanks for your contribution.

As part of this PR, please:

  1. Mark McpSchema.CallToolResult#CallToolResult(java.lang.String, java.lang.Boolean) as deprecated.
  2. Update McpAsyncServer and McpStatelessAsyncServer to use the builder instead of that constructor
  3. Remove test usages of that constructor as well

@Kehrlann Kehrlann added the waiting for user Waiting for user feedback or more details label Nov 18, 2025
codeboyzhou added a commit to codeboyzhou/mcp-java-sdk that referenced this pull request Nov 20, 2025
…ol#652

- Mark McpSchema.CallToolResult#CallToolResult(java.lang.String, java.lang.Boolean) as deprecated.
- Update McpAsyncServer and McpStatelessAsyncServer to use the builder instead of that constructor.
- Remove test usages of that constructor as well.
@codeboyzhou
Copy link
Contributor Author

@codeboyzhou thanks for your contribution.

As part of this PR, please:

  1. Mark McpSchema.CallToolResult#CallToolResult(java.lang.String, java.lang.Boolean) as deprecated.
  2. Update McpAsyncServer and McpStatelessAsyncServer to use the builder instead of that constructor
  3. Remove test usages of that constructor as well

@Kehrlann ok, I have finished these three feedbacks and commit again.

codeboyzhou added a commit to codeboyzhou/mcp-java-sdk that referenced this pull request Nov 20, 2025
@codeboyzhou
Copy link
Contributor Author

@Kehrlann By the way, there is also another commit (060d6cd) to remove test usages of deprecated constructor for the Resource class.

Copy link
Contributor

@Kehrlann Kehrlann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

…ol#652

- Mark McpSchema.CallToolResult#CallToolResult(java.lang.String, java.lang.Boolean) as deprecated.
- Update McpAsyncServer and McpStatelessAsyncServer to use the builder instead of that constructor.
- Remove test usages of that constructor as well.
@Kehrlann Kehrlann force-pushed the refactor-replace-deprecated branch from 060d6cd to 927696e Compare November 21, 2025 10:47
@Kehrlann Kehrlann merged commit 7e950eb into modelcontextprotocol:main Nov 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing waiting for user Waiting for user feedback or more details

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants